package com.zbf.dao;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.List;
import java.util.Map;

/**
 * 作者: LCG
 * 日期: 2020/6/3 11:34
 * 描述:
 */

@Mapper
public interface UserDao {

     @Select(value = "select concat(id,'') as id,userName,loginName,DATE_FORMAT(createTime,'%Y-%m-%d %H:%m:%s') as createTime from base_user order by createTime desc")
     public List<Map<String,Object>> getPageList();

     @Insert(value = "insert into base_user_role(id,user_id,role_id)values(#{id},#{userId},#{roleId})")
     public void insertRoleUser(Map<String,Object> map);


     @Delete(value = "delete from base_user_role where user_id=#{userId}")
     public int deleteRoleUser(String userId);

}
